﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Clinica/MasterPageAdmision.master" AutoEventWireup="true" CodeFile="wfCitaListado.aspx.cs" Inherits="Ventas_wfCitaListado" %>

<%@ Register assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>

<%@ Register assembly="DevExpress.ExpressApp.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.ExpressApp.Web.Templates" tagprefix="cc1" %>

<%@ Register assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMenuSecundario" Runat="Server">
    <li><a href="wfAdmisionPacienteListado.aspx" class="">Admisión Paciente</a></li>
    <li><a href="wfCitaListado.aspx" class="active">Cita</a></li>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ModuleTitleContent" Runat="Server">
    Cita
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentEnlacesRapidos" Runat="Server"></asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" Runat="Server">
    <ul class="tabs primary">
        <li class="active"><a href="wfCitaListado.aspx">Listado de Citas</a></li>
        <li><a href="wfCita.aspx" class="">Registrar Cita</a></li>
    </ul>
    <h4>Listado de Citas</h4>
    <script language="javascript" type="text/javascript">

        function confirmSubmit()
        {
//            $.prompt('Está seguro de querer eliminar la cita?'
//            , {
//                buttons: { Ok: true, Cancel: false }
//                , prefix: 'cleanblue'
//                , callback: confirmSubmitResult
//            }
//        );
            //            return false;

            pcEliminar.Show();
        }

        function confirmSubmitResult()
        {
//            if (v) //post back if the user clicked OK
                $('#<%= btnAnulacion.ClientID %>').click();
        }    
    </script>
    <script type="text/javascript">
    // <![CDATA[
        function ShowMensaje() {pc_Mensaje.Show();}
//        function ShowCreateAccountWindow() {
//            pcCreateAccount.Show();
//            tbUsername.Focus();
//        }
    // ]]> 
    </script>
    <table width="99%">
        <tr>
            <td>
                <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="99%">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                            <table>
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="btnAgregar" runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                                            CssPostfix="PlasticBlue" 
                                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" Text="Agregar" 
                                            OnClick="AgregarCita">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="btnModificar" runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                                            CssPostfix="PlasticBlue" 
                                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" Text="Modificar" 
                                            OnClick="ModificarCita">
                                        </dx:ASPxButton>
                                    </td>
                                    <%--<td>
                                        <dx:ASPxButton ID="ASPxButton3" runat="server" ClientIDMode="AutoID" 
                                            CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" 
                                            OnClick="ASPxButton3_Click" 
                                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" 
                                            Text="Eliminar" Native="True">
                                        </dx:ASPxButton>
                                    </td>--%>
                                    <td>
                                        <dx:ASPxButton ID="btnAnular" runat="server" AutoPostBack="False"
                                            CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue"
                                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" 
                                            Text="Eliminar">
                                            <ClientSideEvents Click="function(s, e) {return confirmSubmit();}" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                    <asp:Button ID="btnAnulacion" runat="server" BackColor="#99CCFF" Style="display: none;" Text="Anular" OnClick="EliminarCita" />
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxPanel>
            </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxGridView ID="dgListadoCita" runat="server" AutoGenerateColumns="False" 
                    KeyFieldName="CIT_ID_CITA" 
                    CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" >
                    <Columns>
                        <dx:GridViewDataTextColumn FieldName="CIT_ID_CITA" VisibleIndex="0" Caption="Nº Cita" SortIndex="0" SortOrder="Descending">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataDateColumn FieldName="CIT_FECHA" VisibleIndex="1" Caption="Fecha">
<PropertiesDateEdit>
<CalendarProperties ClearButtonText="Vaciar" TodayButtonText="Hoy">
<FastNavProperties OkButtonText="Aceptar" CancelButtonText="Cancelar"></FastNavProperties>
</CalendarProperties>

<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesDateEdit>
                        </dx:GridViewDataDateColumn>
                        <dx:GridViewDataTextColumn FieldName="PAC_APELLIDO_PATERNO" VisibleIndex="2" Caption="Apellido Paterno">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="PAC_APELLIDO_MATERNO" VisibleIndex="3" Caption="Apellido Materno">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="PAC_NOMBRES" VisibleIndex="4" Caption="Nombres">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="ESC_DESCRIPCION" VisibleIndex="5" 
                            Caption="Estado">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="PRM_DESCRIPCION" VisibleIndex="6" 
                            Caption="Dia" Visible="False">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="TUR_DESCRIPCION" VisibleIndex="7" 
                            Caption="Turno">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="HOR_HORARIO" VisibleIndex="8" 
                            Caption="Horario">
<PropertiesTextEdit>
<ValidationSettings ErrorText="Valor inv&#225;lido">
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
</PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Medico" FieldName="NombreEmpleado" 
                            VisibleIndex="12">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Especialidad" FieldName="ESP_NOMBRE" 
                            VisibleIndex="10">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowFocusedRow="True" />
                    <SettingsPager ShowDefaultImages="False">
                        <AllButton Text="All"></AllButton>
                        <NextPageButton Text="Next &gt;"></NextPageButton>
                        <PrevPageButton Text="&lt; Prev"></PrevPageButton>
                    </SettingsPager>
                    <Settings ShowFilterRow="True" ShowGroupPanel="True" />

<SettingsLoadingPanel Text="Cargando&amp;hellip;"></SettingsLoadingPanel>
                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                        </LoadingPanelOnStatusBar>
                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                        </LoadingPanel>
                    </Images>
                    <ImagesFilterControl>
                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                        </LoadingPanel>
                    </ImagesFilterControl>
                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" 
                        CssPostfix="PlasticBlue">
                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                        </Header>
                    </Styles>
                    <StylesEditors>
                        <CalendarHeader Spacing="11px">
                        </CalendarHeader>
                        <ProgressBar Height="25px">
                        </ProgressBar>
                    </StylesEditors>
                </dx:ASPxGridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="listarVista" TypeName="Negocio.Clases_BL.clsAdmCitaBL"></asp:ObjectDataSource>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

                <dx1:ASPxPopupControl ID="pcEliminar" runat="server" Width="350px" AllowDragging="True" AllowResize="True" ClientInstanceName="pcEliminar" 
                    CloseAction="CloseButton" HeaderText="Eliminar" Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" DragElement="Window">
                    <HeaderImage Url="~/Imagenes/delete2.png" Width="20px"></HeaderImage>
                    <HeaderStyle Font-Bold="True" BackColor="#3D5294" ForeColor="White" />
                    <ContentCollection>
                        <dx1:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                            <table class="style1">
                                <tr>
                                    <td colspan="2" style="padding: 0 0 0 20px;">
                                        ¿Está Seguro De Querer Eliminar La Cita?<hr /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding: 0 20px 0 0;">                
                                        <dx:ASPxButton ID="btnAceptarEliminar" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Aceptar" Checked="True">
                                            <ClientSideEvents Click="function(s, e) {
	                                                                                    pcEliminar.Hide();
	                                                                                    confirmSubmitResult();    
                                                                                    }" 
                                              />
                                            <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Names="Georgia" ForeColor="White"></CheckedStyle>
                                            <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White"></HoverStyle>
                                        </dx:ASPxButton>
            
                                    </td>
                                    <td align="left" style="padding: 0 0 0 20px;">            
                                        <dx:ASPxButton ID="btnCancelarEliminar" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Cancelar" Checked="True">
                                            <ClientSideEvents Click="function(s, e) {pcEliminar.Hide();}" />
                                            <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Names="Georgia" ForeColor="White"></CheckedStyle>
                                            <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White"></HoverStyle>
                                        </dx:ASPxButton>            
                                    </td>
                                </tr>
                            </table>
                        </dx1:PopupControlContentControl>
                    </ContentCollection>
                </dx1:ASPxPopupControl>

                <dx1:ASPxPopupControl ID="pcMensaje" runat="server" Width="350px" AllowDragging="True" AllowResize="True" ClientInstanceName="pcMensaje" 
                    CloseAction="CloseButton" HeaderText="Mensaje" Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" DragElement="Window">
                    <HeaderImage Url="~/Imagenes/iconError.png" Width="20px"></HeaderImage>
                    <HeaderStyle Font-Bold="True" BackColor="#3D5294" ForeColor="White" />
                    <ContentCollection>
                        <dx1:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                            <table class="style1">
                                <tr>
                                    <td style="padding: 0 0 0 20px; text-align:center">
                                        <dx:ASPxLabel ID="lblMensaje" runat="server"></dx:ASPxLabel>
                                        <hr />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                
                                        <dx:ASPxButton ID="btnAceptar" runat="server" AutoPostBack="False" 
                                            ClientIDMode="AutoID" Text="Aceptar" 
                                            Checked="True">
                                            <ClientSideEvents Click="function(s, e) {pcMensaje.Hide();}"/>
                                            <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Italic="False" Font-Names="Georgia" Font-Strikeout="False" ForeColor="White"></CheckedStyle>
                                            <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White"></HoverStyle>
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </dx1:PopupControlContentControl>
                    </ContentCollection>
                </dx1:ASPxPopupControl>
                <br />
            </td>
        </tr>
    </table>
</asp:Content>

